package cn.smbms.tools;

import java.sql.SQLException;

import org.apache.commons.dbcp.BasicDataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ACT {

	private static ApplicationContext applicationContext=null;
	private static BasicDataSource basicDataSource=null;
	
	static{
		
	applicationContext=new ClassPathXmlApplicationContext("ApplactionContext-Spring.xml");
	basicDataSource=(BasicDataSource)applicationContext.getBean("dataSource");
	}
	
	public static ApplicationContext getACT(){
		
		return applicationContext;
	
	}
	
	public static BasicDataSource getBasicDataSource(){
		/*try {
			basicDataSource.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		return basicDataSource;
	}
	public static void close(){
		/*try {
			basicDataSource.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		
	}
	
	
}
